#ifndef VIEW_H_
#define VIEW_H_
#include <QGraphicsView>
#include <QKeyEvent>
#include <QTimer>
#include <QUdpSocket>
#include <QtGui/QGraphicsScene>

#include <QBuffer>

#include "player.h"
#include "map.h"
#include "mouse.h"
#include "packet.h"

/*

View - klasa wyswietlajaca pole bitwy

 */

class View : public QGraphicsView{

        Q_OBJECT

public:
    View(QWidget *parent = 0);
    Mouse *getMouse() const
    {
        return mouse;
    }

    Map *getMap() const
    {
        return map;
    }

protected:
    void mouseMoveEvent(QMouseEvent *evt);
    void mousePressEvent(QMouseEvent *evt);
    void mouseReleaseEvent(QMouseEvent *evt);
private:
    Map *map;
    Mouse *mouse;
    QTimer *timer;
    Player* player;
private slots:
    void timerTick();
protected:
        void mouseMoved(qreal x, qreal y);

};

#endif /* VIEW_H_ */
